package org.example.demo1;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Gong.Yang
 * 演示run和start方法的区别
 */
@Slf4j
public class DemoRunAndStart {
    public static void main(String[] args) {
        Runnable task = () -> {
            log.info("currentThread->{}", Thread.currentThread());
        };
        Thread thread = new Thread(task, "simple thread");
        thread.run();    //currentThread->Thread[main,5,main]
        thread.start(); //currentThread->Thread[simple thread,5,main]
    }

}
